package com.szrt.oa.actor.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.szrt.oa.actor.dao.ActorDao;
import com.szrt.oa.actor.entity.ActorEntity;
import com.szrt.oa.actor.service.ActorService;


@Service
public class ActorServiceImpl implements ActorService {
	
	
	@Autowired
	private ActorDao  dao ;
	
	
	
	/**
	 * readOnly=true 查询  只读事物 不会自动提交
	 * readOnly=false 新增 修改  删除
	 * @param entity
	 * @return
	 * @throws Exception
	 */
	@Transactional(readOnly=false)
	@Override
	public int insert(ActorEntity entity) throws Exception{
		System.out.println(dao.getClass().getName());
		return dao.insert(entity);
		
	}



	@Transactional(readOnly=true)
	@Override
	public List<ActorEntity> findAll() throws Exception {
		return dao.findAll();
	}

}
